<html>
<head>
    <meta charset="UTF-8">
    <title>Vue</title>
    <style>
        body {
            padding: 0;
            margin: 20px;
            text-align: center;
        }

        .bd {
            display: flex;
            align-items: center;
        }

        textarea {
            flex: 1;
            height: calc(100vh - 140px);
            padding: 10px;
            margin-right: 10px;
            resize: none;
            overflow-y: auto;
            border: 1px #dfdfdf solid;
        }

        .pre {
            flex: 1;
            height: calc(100vh - 160px);
            border: 1px #dfdfdf solid;
            text-align: left;
            overflow-y: auto;
            padding: 10px;
            position: relative;
        }

        .pre span {
            width: 60px;
            height: 25px;
            position: absolute;
            right: 0;
            top: 0;
            background: dodgerblue;
            color: #fff;
            font-size: 12px;
            text-align: center;
            line-height: 25px;
            cursor: pointer;
        }

        button {
            margin-top: 20px;
            width: 100px;
            height: 40px;
            background: dodgerblue;
            border: 0;
            color: #fff;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="bd">
    <textarea id="input" placeholder="请输入需要转换的代码"></textarea>
    <div class="pre">
        <pre id="output" ></pre>
    </div>
</div>
<button id="btn">转换</button>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        $('#btn').click(function () {
            let input = $('#input').val() && $('#input').val().toString() || '';
            $.ajax({
                "async": true,
                "crossDomain": true,
                "url": "http://127.0.0.1:9100/epsoft/vue",
                "method": "POST",
                "headers": {
                    "cache-control": "no-cache",
                    "Postman-Token": "b40fbd87-ebd5-4b24-a76b-5ac1ab58dacc"
                },
                "data": {body: JSON.stringify(input)},
                success: function (res) {
                    $('#output').text(res);
                    $('#foo').text(res);
                }
            });
        });
    });
</script>
</body>
</html>